package com.example.fist.personRepository;

import com.example.fist.entity.AdminEntity;
import com.example.fist.entity.CodeEntity;
import com.example.fist.entity.DetailsEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface DetailsJpaRepository  extends JpaRepository<DetailsEntity, Integer>  {

    @Query(nativeQuery = true, value = "SELECT * FROM details WHERE de_id = :de_id ")
    DetailsEntity get(@Param("de_id") int de_id ) ;

    @Query(nativeQuery = true, value = "SELECT * FROM details")
    Page<DetailsEntity> findAllPage(Pageable pageable);

    @Query(nativeQuery = true, value = "SELECT count(*) FROM details")
    int findAllCount();
}
